package com.tq.auth.client;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 示例跳转
 *
 * @author TqCoder
 * @since 2.0.0
 */
@Controller
public class HomeController {
    /**
     * 首页：提供一个按钮跳转到授权服务器
     */
    @GetMapping("/")
    public String index() {
        return "index";
    }

    /**
     * 授权回调后展示用户信息
     */
    @GetMapping("/welcome")
    public String welcome(@RequestParam String info, Model model) {
        model.addAttribute("userInfo", info);
        return "welcome";
    }
}
